import os
# from django.core.mail import send_mail
from django.core.mail import EmailMultiAlternatives

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'liujiang_login.settings')

if __name__ == "__main__":
    subject,from_email,to = 'from liujiang_login test email','liangfuting007@163.com','151295139@qq.com'
    text_content = 'welcome to mysite,share you knowledge.'
    html_content = "<p> welcome to<a href='http://127.0.0.1:8000/index'>mysite</a>,share you knowledge.</p>"
    msg= EmailMultiAlternatives(subject,text_content,from_email,[to])
    msg.attach_alternative(html_content,'text/html')
    msg.send()
